<?php
require_once 'application/models/AbstractModel.php';

class Utilisateur extends AbstractModel
{
    protected $_name = 'Utilisateur';

    function __construct() {
        parent::__construct();
    	$this->_fieldsToDisplay = array('firstname', 'lastname', 'menu_id', 'private_menu_id', 'default_char_size', 'default_display_time', 'default_dictee', 'default_inverse', 'default_feedback', 'default_assist', 'default_tempo');
    }

	public static function publicUserDatas($user) {
		$publicData = array();
		$publicData['isGuest'] = false;
		$publicData['firstname'] = $user->firstname;
		$publicData['lastname'] = $user->lastname;
		$publicData['menu_id'] = $user->menu_id;
		$publicData['private_menu_id'] = $user->private_menu_id;
		$publicData['default_char_size'] = $user->default_char_size;
		$publicData['default_display_time'] = $user->default_display_time;
		$publicData['default_dictee'] = $user->default_dictee;
		$publicData['default_inverse'] = $user->default_inverse;
		$publicData['default_feedback'] = $user->default_feedback;
		$publicData['default_assist'] = $user->default_assist;
		$publicData['default_tempo'] = $user->default_tempo;
		return $publicData;
	} 
	
	public static function guestUserDatas() {
		$guestData = array();
		$guestData['isGuest'] = true;
		$guestData['firstname'] = null;
		$guestData['lastname'] = null;
		$guestData['menu_id'] = 1;
		$guestData['private_menu_id'] = null;
		$guestData['default_char_size'] = "1";
		$guestData['default_display_time'] = "1";
		$guestData['default_dictee'] = "1";
		$guestData['default_feedback'] = "1";
		$guestData['default_inverse'] = "0";
		$guestData['default_assist'] = "1";
		$guestData['default_tempo'] = "0";
		return $guestData;
	} 
    
}
    	